package com.example.demo.util;

/**
 * @author shuxiangcheng
 * @Description 返回页面状态结果
 */
public class SmsResult {
	
	private String code = CodeEnum.EXCEPTION_FAIL.getValue();
	private String desc = CodeEnum.EXCEPTION_FAIL.getDesc();
	private String data;
	
	public SmsResult() {
	}
	/**
	 * 
	 * @param code
	 *            状态值CodeEnum对象
	 */
	public SmsResult(CodeEnum code) {
		this.code = code.getValue();
		this.desc = code.getDesc();
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public String getData() {
		return data;
	}
	public void setData(String data) {
		this.data = data;
	}

	public enum CodeEnum {
		SUCCESS("000", "发送成功！"),
		REQUEST_SUCCESS("000", "获取报文成功！"),
		/*登录错误码*/
		LOGIN_FAIL("001", "登录失败！"),
		LOGIN_PASSWORD_ERROR("002", "登录密码不正确！"),
		LOGIN_NAME_ERROR("003", "登录帐号不正确！"),
		LOGIN_VALIDCODE_ERROR("004", "登录验证码不正确！"),
		LOGIN_CUSTOMER_NO_ERROR("004", "登录客户编码正确！"),
		
		FILE_UPLOAD_SUCCESS("000","%s 文件上传成功！"),
		FILE_PHONES_MAX("997", "单个文件最多上传%s号码！"),
		FILE_CONTENT_EMPTY("998", "文件内容数据无效，请重新上传！"),
		OTHER_FAIL("005","停用或者删除失败！"),
		
		NO_EXISTENT_FAIL("006","帐号不存在，请重新填写！"),
		PART_NO_EXISTENT_FAIL("007","帐号：%s不存在，请正确填写！"),
		ACC_SUCCESS("008","%s"),
		UNKNOWN_SUCCESS("009","未知错误，请联系管理员！"),
		BODY_NULL("333","发送消息为空！"),
		CHATBOTID_NULL("333","chatbotid为空！"),
		PLATFORM_NULL("333","未指定平台发送！"),
		CHATBOTID_NO_EXIT("333","chatbotid不存在！"),
		RESPONSE_NULL("333","响应消息为空！"),
		EXCEPTION_FAIL("999", "发送失败！"),
		FAIL("999", "失败");
		
		CodeEnum(String value, String desc) {
			this.value = value;
			this.desc = desc;
		}

		private String value;
		private String desc;

		public String getValue() {
			return value;
		}

		public String getDesc() {
			return desc;
		}
	}
	
}
